package org.yenn.pattern.aliyun.behavioral.memento;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * 步骤 2
 * 创建 Originator 类。
 */
@Getter
@Setter
@ToString
public class Originator {

    private String state;

    public Memento saveStateToMemento() {
        return new Memento(state);
    }

    public void getStateFromMemento(Memento Memento) {
        state = Memento.getState();
    }
}